<?php if (!empty($errorMessages)): ?>
<div class="ml-error">
<?php
echo '<ul>';
foreach ($errorMessages as $error){
    echo '<li>'.$error.'</li>';
}
echo '</ul>';
?>
</div>
<?php endif; ?>
<?php
echo $form;
?>
<script type="text/javascript">
    $(document).ready(function(){
        var parent = $("form[name=<?php echo $form->getName(); ?>]").parent();
        $("form[name=<?php echo $form->getName(); ?>]").ajaxForm({
            target: parent
        });
    });
</script>